package com.wpam.scrabble.mobile.communication;

import java.io.IOException;
import java.util.ArrayList;

import com.wpam.scrabble.mobile.activities.ServerSearchActivity;
import com.wpam.scrabble.mobile.activities.ServerSearchActivity.ServerAdapter;
import com.wpam.scrabble.mobile.communication.bt.DeviceNetworkInfo;
import com.wpam.scrabble.mobile.messages.Message;

import android.app.Activity;
import android.bluetooth.BluetoothDevice;
import android.widget.TextView;

public interface InterfaceManager {
	
	
	public Activity getParentActivity();
	
	public void stopCurrentActions();
	public void runServerSearch();
	public void runConnect(BluetoothDevice device);
	
	public void disconnectClient();
	public void disconnectAllClients();
	public void disconnectSingleClient(BluetoothDevice senderDevice);
	public void disconnectSelfGently() throws IOException;

	public void startReconnectTask();
	public void stopReconnectTask();
	public void stopAcceptorTask();
	
	public void startDisconnectListener();
	public void resumeDisconnectListener();
	public void stopDisconnectListener();

	public void startDiscoveryListener(ServerSearchActivity parent, ServerAdapter adapter, TextView status);
	public void resumeDiscoveryListener();
	public void stopDiscoveryListener();
	
	public void writeAsServer(DeviceNetworkInfo receiver, byte[] buffer);
	public void writeAsServer(BluetoothDevice receiver, byte[] buffer) throws Exception;
	public void writeAsClient(byte[] buffer) throws IOException;
	
	public String getMyName();
	public ArrayList<DeviceNetworkInfo> getConnectedPlayers();
	public boolean isPlayerConnected(String name);

	public void forwardMessage(Message message);




	
}
